package com.read.util;

import java.io.InputStream;
import java.util.Properties;

/**
 * @description Java 操作Properties 工具类
 * @author sh-sunb6
 * @date 2019-01-16 11:04
 */
public class PropertiesUtil {

	private static Properties application = new Properties();
	
	static {
		try {
			String profile = SpringContextUtil.getActiveProfile();
			InputStream is = PropertiesUtil.class.getClassLoader().getResourceAsStream("application-"+profile+".properties");
			application.load(is);
			is.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static String getProperty(String key){
		return application.getProperty(key);
	}
}
